home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_06
/
9n06061a
< prev
next >
Wrap
Text File
|
1991-02-23
|
979b
|
52 lines
// class StructThing -- a struct thing derived from
// class Thing.
//
// Version 1.01 -- 2/25/91
//
// Michael Kelly -- Author
//
#if !defined(TH_STRUC_HPP)
#define TH_STRUC_HPP
#include "thing.hpp"
struct a_struct {
char key[ 16 ];
int id;
};
class StructThing : public Thing {
public:
StructThing()
{
thing = new a_struct;
}
StructThing( a_struct &some_thing )
{
thing = new a_struct(some_thing);
}
long type()
{
return ( (long)StructType << 16) | sizeof(a_struct);
}
operator a_struct() { return *( (a_struct *)ptr() ); }
void print();
int printable() { return 1; }
int sortable() { return 1; }
operator ==(Thing &some_thing);
operator !=(Thing &some_thing);
operator < (Thing &some_thing);
operator <=(Thing &some_thing);
operator > (Thing &some_thing);
operator >=(Thing &some_thing);
};
#endif